
const FilterArrayByKeys = (array: any[], keys: string[], keyword: string) => {
  let newArr = []
  if (keyword == '' || keys.length == 0) {
    return array
  }
  for (let i = 0; i < array.length; i++) {
    let isInclude = false
    for (let j = 0; j < keys.length; j++) {
      if (array[i][keys[j]].includes(keyword)) {
        isInclude = true
        break
      }
    }
    if (isInclude) {
      newArr.push(array[i])
    }
  }
  return newArr
}

export default FilterArrayByKeys
